package o2o.service.sys;

import o2o.cache.sys.SysConfigXcxPushMemory;
import o2o.config.dao.UserDaoSql;
import o2o.dao.PO.PojoTables;
import o2o.dao.PO.sys.SysConfigXcxPush;
import org.springframework.stereotype.Service;

import java.sql.SQLException;
import java.util.List;

/**
 * @author qilonghe【1061268464@qq.com】
 * @ClassName AppletPushService
 * @Description:
 * @date 2020/11/2 0002 上午 9:11
 * @Version 1.0
 */
@Service
public class SysConfigXcxPushService {
    // 查询配置信息
    public List<SysConfigXcxPush> list(String appFlag) {
        return SysConfigXcxPushMemory.getInstance().list(appFlag);
    }

    // 更新配置信息
    public void modify(SysConfigXcxPush sysConfigXcxPush) throws SQLException {
        UserDaoSql.getInstance().updateObj(PojoTables.SYS_CONFIG_XCX_PUSH, sysConfigXcxPush, "id", sysConfigXcxPush.getId());

        // 更新缓存
        SysConfigXcxPushMemory.getInstance().run();
    }
}